package com.miaosha.response;

/**
 * @Author: lxj
 * @Date: 2021.03.16 16:49
 * @version: 1.0
 */
public class CommonResultType {
    //对应请求的返回处理结果
    private String status;
    private Object data;
    //定义一个通用的创建方法
    public static CommonResultType create(Object result){
        return create(result,"success");
    }

    public static CommonResultType create(Object result,String status){

        CommonResultType commonResultType = new CommonResultType();
        commonResultType.setStatus(status);
        commonResultType.setData(result);
        return commonResultType;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
